package eteam.aps.controller;

import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.common.helper.JsonPage;
import eteam.aps.model.entity.ProductCategory;
import eteam.aps.model.vo.ProductCategoryVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

public interface IProductCategoryController {

    @PostMapping("/ec/insert")
    R<Integer> insert(@RequestBody ProductCategory productCategory) throws Exception, AuthException;

    @PostMapping("/ec/delete/{fId}")
    R<Integer> delete(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/ec/update")
    R<Integer> update(@RequestBody ProductCategory productCategory) throws Exception, AuthException;

    @PostMapping("/ec/selectDetails/{fId}")
    R<ProductCategoryVo> selectDetails(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/ec/selectAll")
    R<JsonPage<ProductCategoryVo>> selectAll(
            @RequestParam(value = "fEcCode",required = false) String fEcCode,
            @RequestParam(value = "fEcName",required = false) String fEcName,
            @RequestParam("page") Integer page,
            @RequestParam("pageSize") Integer pageSize
    ) throws Exception, AuthException;
}
